
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.TaskClassDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class TaskClassDaoJdbc extends BaseDaoJdbc implements TaskClassDao {
	String tableName="T_TASK_CLASS";
	String beanName="taskClass";
	
	public CommonBean createTaskClass(){
		CommonBean taskClasss=this.createBean(tableName,beanName);
                return taskClasss;		
	}
	
/*
	public CommonBean findTaskClasss(String refid) {
		CommonBean taskClasss=this.createTaskClass();
		String sql="select * from T_TASK_CLASS where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		taskClasss.addData(data);
                return taskClasss;
       }
*/
	public CommonBean findTaskClassById(String id) {
		CommonBean taskClasss=this.createTaskClass();
		String sql="select * from T_TASK_CLASS where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		taskClasss.addData(data);
    return taskClasss;
  }
  
	public CommonBean findAllTaskClasss() {
		CommonBean taskClasss=this.createTaskClass();
		String sql="select * from T_TASK_CLASS ";
		List data=this.getCommonDao().select(sql,new String[]{});
		taskClasss.addData(data);
    return taskClasss;
  }
	public void insertTaskClass(CommonBean taskClassBean){
		List data=taskClassBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

